package com.dkha.face.contral;

import com.dkha.face.modules.ReceiveSnapVO;
import com.dkha.face.modules.RecevieVO;
import com.google.gson.Gson;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @version V1.0
 * @Description: TODO(please write your description)
 * All rights 成都电科慧安
 * @Title: FaceSnapContal
 * @Package com.dkha.face.contral
 * @author: panhui
 * @date: 2019/12/25 10:59
 * @Copyright: 成都电科慧安
 */
@RestController
@RequestMapping("/face")
@Api(tags = "抓拍机管理")
@Slf4j
public class FaceSnapContal {


    @Autowired
    private Gson gson;

    @PostMapping("/snapshot")
    @ApiOperation(value = "接收抓拍信息")
    public String snapshot(@RequestBody RecevieVO recevieVO)
    {
        String json=gson.toJson(recevieVO);
        log.error("接收卡口数据:"+json);
        return json;
    }

    @PostMapping("/test1")
    @ApiOperation(value = "测试抓拍信息")
    public String snapshot(@RequestBody ReceiveSnapVO receiveSnapVO)
    {
        String json=gson.toJson(receiveSnapVO);
        log.error("接收卡口数据:"+json);

        System.out.println(receiveSnapVO.getBody().getPicture().size());
        return json;
    }

    @PostMapping("/tripWire")
    @ApiOperation(value = "人员绊线统计")
    public String tripWire(@RequestBody RecevieVO recevieVO)
    {
        String json=gson.toJson(recevieVO);
        log.error("接收绊线数据:"+json);
        return json;
    }
}
